home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1994 March
/
1994-03b.d64
/
batch util
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
69 lines
10 data 000,037,147,049,140,048,146,056
20 data 055,148,048,130,057,057,057,031
30 ifpeek(124)=76andpeek(126)=192thenpoke127,0
35 open15,8,15,"u9":open1,0:poke53280,11:poke53281,0
40 n$="":n1$="":n2$=""
50 print"[147][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"
60 print" batch utilities"
70 print"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"
80 print"select:"
90 print" 1- find error"
100 print" 2- convert seq to speedscript"
110 print" 3- print seq file"
120 print" 4- make empty file"
130 print" 5- exit program"
140 geti$:a=val(i$):ifa<1ora>5then140
150 onagoto180,340,490,590:print"[147]";
160 close1:close2:close3:close15:clr
170 end
180 print"[147] ** find error **"
190 input"filename";n$:ifn$=""then40
200 e=peek(50997)+256*peek(50998):e$=""
210 e=e/4096:fori=1to4:a=int(e):e$=e$+chr$(48+a-(a>9)*7)
220 e=16*(e-a):next
230 print"location? $";e$;"[157][157][157][157]";
240 input#1,e$:iflen(e$)<>4ore$="0000"then40
250 e=0:fori=1to4:a=asc(e$):a=a-48+(a>64)*7:e$=mid$(e$,2)
260 e=16*e+a:next:print"[147]":c=0
270 open2,8,2,"0:"+n$+",s,r":gosub1000
280 get#2,i$:a=st:c=c+1:ifi$=chr$(13)theni$="_"+i$
290 ifc>ethenpoke199,1
295 getj$:ifj$=" "thenpoke198,0:wait198,1:getj$
300 ifj$=chr$(13)thena=1
310 printi$;:ifa=0then280
320 close2:print:print" press a key"
330 wait198,15:poke198,0:goto40
340 print"[147] ** convert seq to speedscript **"
350 input"source file";n1$:ifn1$=""then40
360 input"output file";n2$:ifn2$=""then40
370 open2,8,2,"0:"+n1$+",s,r":gosub1000
390 open3,8,3,"0:"+n2$+",p,w":gosub1000
400 restore:fori=1to16:reada
410 print#3,chr$(a);:next:print"[147]"
420 get#2,i$:a=st:j$=i$:ifj$=chr$(13)thenj$="_"
430 printj$;:poke783,1:sys65520:x=peek(782)+40*(peek(782)>39):y=peek(781)
440 i=peek(1023+x+y*40):print#3,chr$(i);:i=st
450 ifi$=chr$(13)thenprint
460 ifithengosub1000
470 ifa=0then420
480 print#3,chr$(146);chr$(48);:close2:close3:goto40
490 print"[147] ** print seq file **"
500 input"filename";n$:ifn$=""then40
510 print"print to device# 4[157]";:input#1,d:ifd=0then40
520 open2,8,2,"0:"+n$+",s,r":gosub1000:open3,d:l=0:p=1:print"[147]"
530 ifl=0thenprint#3,chr$(14);n$,"page";p;chr$(15):print#3:l=2
540 get#2,i$:a=st:ifi$=chr$(13)theni$="_"+i$:l=l+1
550 print#3,i$;
560 ifl=62thenfori=1to4:print#3:next:l=0:p=p+1
570 ifa=0then530
580 close2:print#3:close3:goto40
590 print"[147] ** make empty file **"
600 input"filename";n$:ifn$=""then40
610 open2,8,2,"0:"+n$+",p,w":gosub1000
620 restore:fori=0to15:reada:print#2,chr$(a);:next
630 close2:goto40
1000 ds$=""
1010 get#15,b$:ds$=ds$+b$:ifb$<>chr$(13)then1010
1020 ifleft$(ds$,2)="00"thenreturn
1030 print"[147]error:[146] ";ds$:goto160